<template>
	<view>
		
		<view  v-for="(item,index) in visitingDetailList" :key="index">

		<view class="info-top">
			
			<view class="vi">
				<view class="left">姓名</view>
				<view class="right">{{item.consultants}}</view>
			</view>
			
			<view class="vi">
				<view class="left">性别</view>
				<view class="right">{{item.genderText}}</view>
			</view>
			
			<view class="vi">
				<view class="left">年龄</view>
				<view class="right">{{item.age}} 岁</view>
			</view>
			
			<view class="vi">
				<view class="left">电话号码</view>
				<view class="right">{{item.phone}}</view>
			</view>
			
		</view>
		
		<view class="info-top">
			<view class="vi">
				<view class="left">客户级别</view>
				<view class="right">{{item.manLevelName}}</view>
			</view>
			
			<view class="vi">
				<view class="left">职业</view>
				<view class="right">{{item.job}}</view>
			</view>
			
			<view class="vi">
				<view class="left">来访时间</view>
				<view class="right">{{item.visitDate}}</view>
			</view>
			
			<view class="vi">
				<view class="left">产品意向</view>
				<view class="right">{{item.planShortName}}</view>
			</view>
			
			<view class="vi">
				<view class="left">接待人</view>
				<view class="right">{{item.receptionistMan}}</view>
			</view>
			
		</view>
	
	</view>	
	
		<!-- <button form-type="submit" class="sub_button" @click="toclose()">关闭</button> -->
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: '来访登记详情',
				id:'',
				
				visitingDetailList: [{
					consultId:'',//id
					consultants: "", //姓名
					genderText: "", //性别
					age: "", //年龄
					phone: "", //电话号码
					manLevelName: "", //客户级别
					job: "", //职业
					visitDate: "", //来访时间
					planShortName: "", //产品意向
					receptionistMan: "", //接待人员
				}],
				
			}
		},
		onLoad(option) {
				console.log("+++++++++++++++++"+option.consultId)
				this.id=option.consultId
				console.log("========"+this.id)
				this.visitingDetailInfo();
		},
		methods: {
			async visitingDetailInfo() {
				const res = await this
					.$myRequest({ //await 关键字 只能放在 async 函数内部， await关键字的作用 就是获取 Promise中返回的内容， 获取的是Promise函数中resolve或者reject的值
						url: '/api-sale/control/consult/?consultId='+this.id,
						method: "get",
					})
				console.log(res.msg)
				this.visitingDetailList = res.body.saleConsults.data
				console.log(this.visitingDetailList)
			},
			// toclose(){
			// 	uni.navigateTo({
			// 		url:"/pages/visitingRegistration/visitingSearch"
			// 	});
			// }
		}
	}
</script>

<style>
	page {
		background-color: #ebeff6;
	}
	
	.info-heder {
		width: 100%;
		height: 120rpx;
		background-color: #109ef8;
		text-align: center;
	}
	
	.info-heder text {
		color: white;
		word-spacing: 100rpx;
	}
	
	.info-top {
		background-color: #FFFFFF;
		margin-bottom: 20rpx;
		margin-top: 12rpx;
		font-size: 28rpx;
		font-weight: bold;
	}
	
	.vi {
		height: 80rpx;
		width: 100%;
		display: flex;
		border-bottom: 1rpx solid #ebebeb;
		align-items: center;
	}
	
	.left {
		margin-left: 20rpx;
		width: 30%;
		color: #BBBBBB;
	}
	
	.right {
		width: 70%;
		color: #606060;
	}
	
	.info-wrap {
		align-items: center;
		justify-content: center;
	}
</style>
